#include <iostream>
#include <cassert>
#include <fstream>
#include "../utils/message.h"
#include "syncmessage.h"

using namespace std;

key_t gMessageKey;
int gMessageType;

void readConfig(string pFilePath) {
	ifstream fin(pFilePath);
	
	fin >> gMessageKey;
	fin >> gMessageType;
	
	fin.close();
	
	//cout << gMessageKey << " " << gMessageType << endl;
}

int main(int argc , char** argv) {
	assert(argc == 2);
	
	readConfig(argv[1]);
	
	MessageChannel channel(gMessageKey);
	SyncMessage *message = new SyncMessage(gMessageType);
	
	channel.send(message);
	
	return 0;
}
